<!--
 * @Author: tlm
 * @Date: 2020-09-19 15:13:33
 * @LastEditTime: 2020-09-19 15:45:16
 * @LastEditors: tlm
 * @Description: 
 * @FilePath: \S3DV_WipSurfer\src\components\maincomponent.vue
 * @support by tlm
-->
<template>
  <div class="mainview" ref='mainview'>
    <viewS3DV></viewS3DV>
    <buttonGroup></buttonGroup>
     
  </div>
</template>

<script>
import viewS3DV from '@/components/view/viewS3DV.vue';
import buttonGroup from '@/components/view/button/buttonGroup.vue';
import {BlobLoader} from '@/utils/load/BlobLoader';

export default {
  name: 'mainComponent',
  components:{
      viewS3DV,
      buttonGroup
  },
 
  methods: {
  },
  mounted()
  {
    let blobLoader=new BlobLoader();
    window.addEventListener('message', (e)=> {
      const data = e.data;
      switch (data.cmd) {
         case 'setGeoBlobData':
           blobLoader.loadGeoBlob(data.blobdata);
           break;
         case 'setGeoGltfData':
           blobLoader.loadGltfBlob(data.blobdata);
           break;
         case 'setAttBlobData':
           blobLoader.loadAttBlob(data.blobdata);
      }  //e.data为传递过来的数据 //e.source为对发送消息的窗口对象的引用，可以使用此来在具有不同origin的两个窗口之间建立双向通信
    },false);
  }
  
}
</script>

<style scoped>
.mainview
{
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 0;
}
</style>
